package com.crrc.yzt.demo.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.crrc.yzt.demo.blue.databinding.ItemValueBinding

class ValueAdapter : RecyclerView.Adapter<ValueViewHolder>() {

    val data = mutableListOf<String>()

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ValueViewHolder {
        val itemBinding: ItemValueBinding = ItemValueBinding.inflate(LayoutInflater.from(parent.context),parent,false)
        return ValueViewHolder(itemBinding)
    }

    override fun getItemCount(): Int {
        return data.size
    }

    override fun onBindViewHolder(holder: ValueViewHolder, position: Int) {
        holder.itemBinding.tvValue.text = data[position]
    }
}

class ValueViewHolder(val itemBinding: ItemValueBinding) : RecyclerView.ViewHolder(itemBinding.root) {

}